from conn_mysql import Connect


class SaceCodeMode(Connect):

    def savecode(self, phone,verify_code):
        save_sql = '''
        insert into verify_code(phone,verify_code)value(%s,%s)
        '''
        self.insert(save_sql,(phone,verify_code))

    def send_sms(self):
        '''发送短信的函数'''
        return {
            'status':1,
            'errorCode':None,
            'errorMsg':None,
            'resultBody':'发送信息成功'}  

    def compares(self):
        compare_sql='''
        select * from verify_code where id=(select MAX(id) from verify_code )
        '''
        result = self.select_one(compare_sql)
        return result['phone']
if __name__ == "__main__":
    x = SaceCodeMode()
    d = x.compares() 
    print(d)